home *** CD-ROM | disk | FTP | other *** search
/ Developer Source 7 / developer source - volume 7.iso / msysj / aug96 / dilaf107.gif < prev    next >
Graphics Interchange Format  |  1997-01-16  |  92KB  |  586x608  |  4-bit (16 colors)
Labels: text | screenshot | number | parallel | font | software
OCR: Figure 7 Conversion Possibilities for Set Functions Case Argument Conversion MFC Conversion Inside Set Function I SetCString(cs) - const CStringt No conversion, just passes a The code pointer to co. mistr - cs: calis $String : : operator-(const CString&) which does a quick copy Equivalent to m_str.operator-(cs); which does m str.m pchData - /7 plus increment ref count 2 SetLPCSTR(cs) CS -> LPCSTR Calls inline The code CString: : operator LPCSTR to convert es to LPCSTR. This 1.str ='cs: calls just gets cs.m_pchData. CString :: operator-(LACSTR) Equivalent to: to allocate and copy bytes. SetLPCSTR(cs.mipchData) : Equivalent to: m.str.operator(ip); /7 allocate, copy $ SctcString(1p) 1-) const CString& Creates a temp variable The code initialized from mestre cs: CString: : CString(-PC51) chills which allocates and copies CString : : operator-(const bytes, Equivalent to: [Stringh) CString tenplip): which does a quick copy. / allocate, copy Equivalent to: Set.CString[ Lemp) : "_ str.operator-(cs); tenp. CString: : - CString(): which does This requires calling m_str.m_ochData- CString: : - UString ci-n achData: when temp goes out of scope. The destructor will deallocate // plus increment ref count m_pchData if no other CString is using it. { SetLPCSTR( Ip) 10 - LPCSTR No conversion, just passes The code pointer Ip. m_str - Ip: calls CStringpcoperator (LPCSTR) to allocate and copy bytes. Equivalent to: m_str. operator-(lp); W allocate, copy cs = CString Ip = LPCSTR red ~ performance hit